package com.imooc.class07.bean;

public abstract class Bean1 {
    private Bean2 bean2;

    public Bean2 getBean2() {
        return bean2;
    }

    public void setBean2(Bean2 bean2) {
        this.bean2 = bean2;
    }

    protected abstract Bean3 createBean3();

    public void printBean3(){
        System.out.println("bean3="+createBean3());
    }

    @Override
    public String toString() {
        return "Bean1{" +
                "bean2=" + bean2 +
                '}';
    }
}
